package com.ddd.domain.model.product;

import com.ddd.domain.share.TrackingId;

import java.util.List;

public interface ProductRepository {

    /**
     * Finds a cargo using given id.
     *
     * @param skuId
     * @return Cargo if found, else {@code null}
     */
    ProductEntity find(TrackingId skuId);

    /**
     * Finds all cargo.
     *
     * @return All cargo.
     */
    List<ProductEntity> findAll();

    /**
     * Saves given cargo.
     *
     * @param cargo cargo to save
     */
    void save(ProductEntity cargo);

    /**
     * @return A unique, generated tracking Id.
     */
    TrackingId nextTrackingId();

    /**
     *
     * @param productEntity
     * @return
     */
    boolean update(ProductEntity productEntity);
}
